package com.mccken.eshop.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单号类型枚举
 *
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-08-28 16:49
 **/
@AllArgsConstructor
@Getter
public enum OrderNoTypeEnum {

	SALE_ORDER(10, "正向订单号"),
	AFTER_SALE(20, "售后单号"),

	;

	private final Integer code;
	private final String desc;

	public static OrderNoTypeEnum parse(Integer code) {

		for (OrderNoTypeEnum item : OrderNoTypeEnum.values()) {
			if (item.getCode().equals(code)) {
				return item;
			}
		}

		return null;
	}

}
